import {lazy} from "react"
import {Navigate} from "react-router-dom"
const Home = lazy(()=>import("../pages/Home"))
const My = lazy(()=>import("../pages/My"))
const Login = lazy(()=>import("../pages/Login"))
const Movie = lazy(()=>import("../pages/Movie"))
const Cinema = lazy(()=>import("../pages/Cinema"))
const Deatil = lazy(()=>import("../pages/Deatil"))
const routercofig = [
    {
        path:"/my",
        element:<My></My>
    },
    {
        path:"/detail/:ID",
        element:<Deatil></Deatil>
    },
    {
        path:"/login",
        element:<Login></Login>
    },
    {
        path:"/home",
        element:<Home></Home>,
        children:[
            {
                path:"/home/movie",
                element:<Movie></Movie>
            },
            {
                path:"/home/cinema",
                element:<Cinema></Cinema>
            },
            {
                path:"/home",
                element:<Navigate to="/home/movie"></Navigate>
            }
        ]
    },
    {
        path:"/",
        element:<Navigate to="/home"></Navigate>
    }
]
export default routercofig